﻿/// <reference path="Dialog.js" />

$(function () {
    $("#btnAdd_Personal").click(function () {
        $.yms_Dialog("p_modal", "/Personal/Add_Personal_Inspiration", function () {
            $("#Modal-Add").click(function () {
                var flag = false;
                if ($(":radio[name='optionsRadios']:checked").val() == "public")
                {
                    flag = false;
                }
                else
                {
                    flag = true;
                }
               
                if ($.trim($("#txt_idea-dec").val()) == "") {
                    alert("请填写灵感描述");
                    return false;
                }
                ajaxK_V(
                    "post", false, false,
                    {
                        idea_dec: $.trim($("#txt_idea-dec").val()),
                        idea_publisher: $.trim($("#txt_idea-publisher").val()),
                        idea_ByQQ: $("#uid").val(),
                        idea_IsPrivate: flag
                    }, "/Personal/Add", "json", function (data) {
                        $('#myModal').modal("hide");
                        location = location;
                    });
            });
        });
    });

    //返回首页
    $("#btnBackIndex").click(function () {
        location.href = "/Home/Index";
    });
});